package city.spring.modules.reception.repository;

import city.spring.modules.reception.entity.AdvisoryEntity;
import city.spring.modules.reception.vo.AdvisoryListVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 存储库：咨询记录
 *
 * @author 侯坤林
 * @date 2020-06-23 10:56:54
 */
@Repository
public interface AdvisoryRepository extends BaseMapper<AdvisoryEntity> {
    /**
     * 查询咨询记录内容（关联老人信息表查询）
     *
     * @param page    分页对象
     * @param wrapper 查询对象
     */
    Page<AdvisoryListVO> queryPage(Page<? extends AdvisoryEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends AdvisoryEntity> wrapper);

    /**
     * 根据老人id查找咨询记录
     *
     * @param oldmanId
     * @return
     */
    AdvisoryEntity getAdvisoryByOldmanId(@Param("oldmanId") String oldmanId);
}